Import Word document with Tables. Tables are child of text.

Hello,

When i export from Word to DOORS (using macro in doors.dot), if i have something like that :

some text
table

in DOORS module i have :
some text

  • table

id table is a child of some text.

A want have table at the same level than some text, because it is a big job to promote all tables in our modules !

I don't understand why we have this problem and how to do to solve it.

Pierre
PDU - Tue Feb 22 10:43:57 EST 2011

Re: Import Word document with Tables. Tables are child of text.
llandale - Tue Feb 22 12:56:18 EST 2011

Yes, it imports the table one level down. I think you can manuever the table by turning off viewing tables in the View menu which lets you see the table as a single object, you can then move that object, presumably "after" the object just above it. I think instead you could also select the entire table, "cut" it, and "paste" it "after" that object.

As always when manipulating the hierarchy, display the Object Level attribute.

  • Louie

Re: Import Word document with Tables. Tables are child of text.
kbmurphy - Tue Feb 22 14:23:00 EST 2011

llandale - Tue Feb 22 12:56:18 EST 2011
Yes, it imports the table one level down. I think you can manuever the table by turning off viewing tables in the View menu which lets you see the table as a single object, you can then move that object, presumably "after" the object just above it. I think instead you could also select the entire table, "cut" it, and "paste" it "after" that object.

As always when manipulating the hierarchy, display the Object Level attribute.

  • Louie

Or you can convert the tables to OLE objects beforehand...

http://www.baselinesinc.com/?page_id=11&filerepoaction=showpost&filepost_id=2

Re: Import Word document with Tables. Tables are child of text.
SystemAdmin - Tue Feb 22 17:56:28 EST 2011

Bit of trivia - if memory serves me correctly - when QSS introduced the DOORS tables feature a long time ago, the rationale for imported MSWord tables being replicated as a DOORS table one level below the preceding object was because it was assumed that the preceding object contains the caption text for the table, and that the table should be a child of this caption - the convention being that captions for tables are always above the table.

This could have been a clever excuse for a bad implementation, but the DOORS MSWord import feature has been doing this since I think about version 4.x.


Paul Miller
Melbourne, Australia

Re: Import Word document with Tables. Tables are child of text.
PDU - Wed Feb 23 01:19:06 EST 2011

kbmurphy - Tue Feb 22 14:23:00 EST 2011
Or you can convert the tables to OLE objects beforehand...

http://www.baselinesinc.com/?page_id=11&filerepoaction=showpost&filepost_id=2

Yes Kevin, i know that,

but my problem is :
  • customer write requirement in word documents.
  • requirement are in word tables, with word style for each cell
  • after import we use a DXL script to transform each table in objects with attribute depending paragraph style.

I see two solutions :
  • one manually, as describe by Louie
  • by script. But it is not simple because you can have a table after a text, but also a table after a table. I look at that.

Thanks
Pierre

Re: Import Word document with Tables. Tables are child of text.
PDU - Wed Feb 23 08:48:21 EST 2011

PDU - Wed Feb 23 01:19:06 EST 2011
Yes Kevin, i know that,

but my problem is :

  • customer write requirement in word documents.
  • requirement are in word tables, with word style for each cell
  • after import we use a DXL script to transform each table in objects with attribute depending paragraph style.

I see two solutions :
  • one manually, as describe by Louie
  • by script. But it is not simple because you can have a table after a text, but also a table after a table. I look at that.

Thanks
Pierre

Hi,

i have written a little script, not very efficient i think, but works fine (on a little test module) :


Module CeModule = current Object ObjetEnCours = current Object ObjetPrecedent = current   bool ObjetPrecedent_EstTexte = 

false bool ObjetPrecedent_EstTitre = 

false bool ObjetPrecedent_EstTable = 

false   bool ObjetEnCours_EstTexte = 

false bool ObjetEnCours_EstTitre = 

false bool ObjetEnCours_EstTable = 

false   bool MoveAfterEffectue = 

true   

while (MoveAfterEffectue == 

true) 
{ MoveAfterEffectue = 

false   

for ObjetEnCours in all CeModule 

do 
{ 

if (table ObjetEnCours) 
{ 
// Table ObjetEnCours_EstTable = 

true 

if (ObjetPrecedent == parent(ObjetEnCours)) 
{ 
// Test precedent object 

if (ObjetPrecedent_EstTexte == 

true) 
{ 
// we need move the Table 'after' Text move (ObjetEnCours, ObjetPrecedent) MoveAfterEffectue = 

true 
} 

else 

if (ObjetPrecedent_EstTitre == 

true) 
{ 
// move the Table 'below' Text  (not necessary) move (ObjetEnCours, below(ObjetPrecedent)) 
} 

else 

if (ObjetPrecedent_EstTable == 

true) 
{ 
// move the Table 'after' Text move (ObjetEnCours, ObjetPrecedent) MoveAfterEffectue = 

true 
} 
} 
} 

else 

if (row ObjetEnCours) 
{ 
} 

else 

if (cell ObjetEnCours) 
{ 
} 

else 

if (ObjetEnCours.
"Object Heading" 
"" != 

null) 
{ 
// Title ObjetEnCours_EstTitre = 

true 
} 

else 
{ 
// Text ObjetEnCours_EstTexte = 

true 
} ObjetPrecedent = ObjetEnCours ObjetPrecedent_EstTexte = ObjetEnCours_EstTexte ObjetPrecedent_EstTitre = ObjetEnCours_EstTitre ObjetPrecedent_EstTable = ObjetEnCours_EstTable 
} 
}


Pierre

Re: Import Word document with Tables. Tables are child of text.
llandale - Wed Feb 23 10:21:11 EST 2011

PDU - Wed Feb 23 08:48:21 EST 2011
Hi,

i have written a little script, not very efficient i think, but works fine (on a little test module) :


Module CeModule = current Object ObjetEnCours = current Object ObjetPrecedent = current   bool ObjetPrecedent_EstTexte = 

false bool ObjetPrecedent_EstTitre = 

false bool ObjetPrecedent_EstTable = 

false   bool ObjetEnCours_EstTexte = 

false bool ObjetEnCours_EstTitre = 

false bool ObjetEnCours_EstTable = 

false   bool MoveAfterEffectue = 

true   

while (MoveAfterEffectue == 

true) 
{ MoveAfterEffectue = 

false   

for ObjetEnCours in all CeModule 

do 
{ 

if (table ObjetEnCours) 
{ 
// Table ObjetEnCours_EstTable = 

true 

if (ObjetPrecedent == parent(ObjetEnCours)) 
{ 
// Test precedent object 

if (ObjetPrecedent_EstTexte == 

true) 
{ 
// we need move the Table 'after' Text move (ObjetEnCours, ObjetPrecedent) MoveAfterEffectue = 

true 
} 

else 

if (ObjetPrecedent_EstTitre == 

true) 
{ 
// move the Table 'below' Text  (not necessary) move (ObjetEnCours, below(ObjetPrecedent)) 
} 

else 

if (ObjetPrecedent_EstTable == 

true) 
{ 
// move the Table 'after' Text move (ObjetEnCours, ObjetPrecedent) MoveAfterEffectue = 

true 
} 
} 
} 

else 

if (row ObjetEnCours) 
{ 
} 

else 

if (cell ObjetEnCours) 
{ 
} 

else 

if (ObjetEnCours.
"Object Heading" 
"" != 

null) 
{ 
// Title ObjetEnCours_EstTitre = 

true 
} 

else 
{ 
// Text ObjetEnCours_EstTexte = 

true 
} ObjetPrecedent = ObjetEnCours ObjetPrecedent_EstTexte = ObjetEnCours_EstTexte ObjetPrecedent_EstTitre = ObjetEnCours_EstTitre ObjetPrecedent_EstTable = ObjetEnCours_EstTable 
} 
}


Pierre

I could not follow your code. But it seems to me you want to do the following:
{code}
o Find a oTable object. When deleted bypass it.
o get the oPrevSib = previous(sibling(oTable)) object. When that oPrevSib is a text object then no move is needed for this table; otherwise (when that object is a Heading) then move the oTable "below" the oPrevSib object.
o When there is no oPrevSib object, get the oParent of the oTable. When that oParent is a heading then its OK; otherwise (when that oParent is a Text object) then move the table "after" its non-table Heading.

Mindful and Manual moves are needed in these odd situations:
o When oPrevSib is deleted and a heading.
o When oParent is deleted then you have an undeleted table under a deleted heading.
o When the table has no previous sibling and no parent, then its the 1st object in the module.

I think I've failed to identify a couple obscure situations, oh well.

  • Louie